Skip to content

[L1T] Extend P2GT members accessors - #51804

Open
artlbv wants to merge 3 commits into
cms-sw:masterfrom
artlbv:claude/p2gt-members-accessors-gthgv7
Open

[L1T] Extend P2GT members accessors#51804
artlbv wants to merge 3 commits into
cms-sw:masterfrom
artlbv:claude/p2gt-members-accessors-gthgv7

Conversation

@artlbv

@artlbv artlbv commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

PR description:

Addresses #51794. FYI @mmusich @BenjaminRS @quinnanm @RobertJWard

l1t::P2GTCandidate exposes only raw hardware ints, so consumers reading the objects straight from the event (e.g. the HLT prototype analyzer, which has no access to the producer's L1GTScales) cannot tell an Et-sum from an Ht-sum, and cannot get isolation or HT in GeV. DPGAnalysis/Phase2L1TNanoAOD worked around this by multiplying the hw value by an LSB hardcoded from the python scales config — the HT line was commented ## HACK via hw value!.

  • P2GTCandidate.h: add isEtSum()/isHtSum() predicates and isolationPT()/scalarSumPT() accessors, backed by two new Optional<double> members, throwing std::invalid_argument when unset like every other getter in the class.
  • L1GTProducer.cc: fill them from the producer's live L1GTScales, so the LSB stays defined only in l1tGTScales.py. All 7 sites that set hwIsolationPT_ (3) or hwScalarSumPT_ (4) are covered.
  • classes_def.xml: register Optional<double>, bump ClassVersion 3 → 4 (checksum="3737213310"), keep the v3 record.
  • l1tPh2GTtables_cff.py: use the accessors for iso, relIso and ht.

Expected output changes: schema change (v3 files stay readable, new members come back unset); the l1tGTProducer product grows ~9% (~210 B/event); no change to any NanoAOD value, since the producer is configured from the same scale_parameter PSet the hardcoded LSBs were copied from.

This is an ABI change. Eight packages #include the header and must be rebuilt: DataFormats/L1Trigger, DataFormats/HLTReco, L1Trigger/Phase2L1GT, DPGAnalysis/Phase2L1TNanoAOD, HLTrigger/HLTcore, HLTrigger/HLTfilters, RecoEgamma/EgammaHLTProducers, RecoHGCal/TICL. NB! a partial local checkout instead yields spurious Object doesn't have qualityFlags from hltTiclSeedingL1 / hltL1TEGammaFilteredCollectionProducer.

No dependencies on other PRs or externals. (The relval used below only runs with #51803, which fixes a pre-existing, unrelated breakage of the Phase-2 L1 nano workflows.)

PR validation:

CMSSW_20_1_0_pre1, el9_amd64_gcc13.

  • Clean build; edmCheckClassVersion passes standalone — the recorded checksum is the value the tool itself reports.
  • NanoAOD A/B vs the unmodified release, same step1.root, single-threaded: L1GTtkPhoton_iso/relIso (n=99), L1GTtkElectron_iso/relIso (n=69) and L1GTscJetSum_ht (n=10) all give max|PR-BASE| = 0 on non-trivial values, as do untouched control branches (hwIso, pt, mht, mhtPhi). NB! The comparison must be single-threaded — the multithreaded Phase-2 L1 chain is not reproducible run-to-run, in the unmodified release as much as here.
  • EDM round-trip, FWLite over the persisted FEVTDEBUGHLT output (443 objects, 13 l1tGTProducer collections), which exercises the v4 dictionary: isEtSum()/isHtSum() true exactly for the Et-/Ht-sum types and false elsewhere; isolationPT() == hwIsolationPT_toInt()*0.25 for CL2Photons/CL2Electrons/GMTTkMuons; scalarSumPT() == hwScalarSumPT_toInt()*0.03125 for CL2EtSum/CL2HtSum/GTTPromptHtSum/GTTDisplacedHtSum; both throw where unset. GTTEtSum sets no scalar sum in the producer, so it throws there — unchanged from the existing hwScalarSumPT() behaviour.
  • Backward compatibility: a file written by the unmodified release (StreamerInfo ClassVersion=3) reads under the v4 dictionary — 198 objects, hardware accessors and objectType_ predicates fine, new members unset, no crash.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

Not a backport; targets master. No backport currently intended.

claude and others added 3 commits September 1, 2026 13:02
…Candidate

l1t::P2GTCandidate was missing an easy way to identify Et-sum/Ht-sum
type objects, and had no physical (GeV) accessor for isolation and HT
(scalarSumPT) -- only the raw hardware ints were exposed, forcing
DPGAnalysis/Phase2L1TNanoAOD's NanoAOD table config to hand-multiply by
a hardcoded LSB pulled from the python scales config as a workaround.

Add isEtSum()/isHtSum() predicates alongside the existing isJet() etc.
Add isolationPT()/scalarSumPT() physical-value accessors, filled by
L1GTProducer from its live L1GTScales at construction time (the same
way pt/eta/phi/z0 already are), so the LSB stays defined in exactly
one place (l1tGTScales.py) instead of being duplicated as a constant
in DataFormats. operator== is left untouched, still comparing only the
bit-exact raw hw fields. Update the NanoAOD table config to use the
new accessors instead of the HACK.

Adding a persisted double is a schema change, so classes_def.xml gets
a new Optional<double> dictionary entry and a ClassVersion bump; the
recorded checksum is a placeholder pending a full build.
Unlike the other hw fields, these had no caller: L1GTProducer builds
P2GTCandidate via friend access (direct private member assignment),
and the only other constructor of this class, L1GTEvaluationInterface.h
(a bit-packing board-emulation path with no L1GTScales access), only
ever populates the raw hw fields. Keep the class free of dead API.
The placeholder checksum 0 was rejected by edmCheckClassVersion during the
DataFormats/L1Trigger dictionary build. Built in CMSSW_20_1_0_pre1
(el9_amd64_gcc13); edmCheckClassVersion reports 3737213310 for the class as
extended by this PR, and passes with that value recorded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ZhBBoZkn3gtRtXmW3FYoM
@cmsbuild

cmsbuild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

cmsbuild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild

cmsbuild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @artlbv for master.

It involves the following packages:

  • DPGAnalysis/Phase2L1TNanoAOD (l1, xpog)
  • DataFormats/L1Trigger (l1)
  • L1Trigger/Phase2L1GT (l1)

@BenjaminRS, @battibass, @cmsbuild, @ftorrresd, @quinnanm can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @eyigitba, @missirol, @mmusich, @rovere, @thomreis this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@mmusich

mmusich commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

enable nano

@mmusich

mmusich commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

test parameters:

  • workflows = ph2_hlt

@mmusich

mmusich commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild, please test

@cmsbuild

cmsbuild commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 36KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-230b12/55647/summary.html
COMMIT: d6f8ea1
CMSSW: CMSSW_20_1_X_2026-09-01-2300/el9_amd64_gcc14
Additional Tests: NANO
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51804/55647/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 61
  • DQMHistoTests: Total histograms compared: 4090018
  • DQMHistoTests: Total failures: 17
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4089983
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 60 files compared)
  • Checked 257 log files, 209 edm output root files, 61 DQM output files
  • TriggerResults: no differences found

Nano size comparison Summary:

workflow id kb/ev ref kb/ev diff kb/ev ev/s/thd ref ev/s/thd diff rate mem/thd ref mem/thd
ScoutingNANOdata124Xrun3 2500.1501 0.772 0.772 0.000 ( +0.0% ) 33.81 34.95 -3.3% 1.560 1.692
ScoutingNANOmonitordata124Xrun3 2500.1502 0.862 0.862 0.000 ( +0.0% ) 12.87 14.50 -11.3% 1.498 1.544
ScoutingNANOdata130Xrun3 2500.1503 1.251 1.251 0.000 ( +0.0% ) 24.87 25.60 -2.8% 1.535 1.669
ScoutingNANOmonitordata130Xrun3 2500.1504 1.297 1.297 0.000 ( +0.0% ) 10.78 10.97 -1.8% 1.494 1.538
ScoutingNANOdata140Xrun3 2500.2307 1.101 1.101 0.000 ( +0.0% ) 29.61 30.71 -3.6% 1.530 1.708
L1ScoutingSelectionNANOdata140Xrun3 2500.2311 0.081 0.081 0.000 ( +0.0% ) 50.59 51.22 -1.2% 0.683 0.850
L1ScoutingNANOdata140Xrun3 2500.231 0.082 0.082 0.000 ( +0.0% ) 4.30 4.39 -1.9% 0.834 0.946
muDPGNANOBkg140Xrun3 2500.2403 2.840 2.840 0.000 ( +0.0% ) 20.03 20.50 -2.3% 1.221 1.284
hcalDPGNANO140Xrun3 2500.2404 486.015 486.015 0.000 ( +0.0% ) 1.17 1.18 -0.9% 1.704 1.846
hcalDPGCalibNANO140Xrun3 2500.2405 826.430 826.430 0.000 ( +0.0% ) 1.51 1.53 -1.1% 1.684 1.820
ScoutingNANOdata150Xrun3 2500.3307 1.738 1.738 0.000 ( +0.0% ) 31.77 32.57 -2.4% 1.533 1.689
L1ScoutingNANOdata150Xrun3 2500.3312 0.078 0.078 0.000 ( +0.0% ) 3.67 3.78 -2.9% 0.842 0.942
L1ScoutingSelectionNANOdata150Xrun3 2500.3313 0.078 0.078 0.000 ( +0.0% ) 27.82 28.12 -1.1% 0.852 0.952
L1ScoutingNANOdata160Xrun3 2500.4301 0.110 0.110 0.000 ( +0.0% ) 2.20 2.25 -2.0% 0.830 0.932
L1ScoutingSelectionNANOdata160Xrun3 2500.4302 0.113 0.113 0.000 ( +0.0% ) 19.58 19.98 -2.0% 0.849 0.966
DYToLL_M-50_13TeV_pythia8 2500.9101 14.970 14.970 0.000 ( +0.0% ) 6.24 6.63 -5.9% 1.219 1.261
DYToll01234Jets_5f_LO_MLM_Madgraph_LHE_13TeV 2500.9102 0.171 0.729 -0.558 ( -76.5% ) 2.85 3.44 -17.1% 0.838 0.858
TTbar_Pow_LHE_13TeV 2500.9103 0.110 0.110 0.000 ( +0.0% ) 2.56 2.96 -13.4% 0.843 0.870
TTbar_14TeV+Run4D127_HLTPhase2WithNano 3000.0001 10.908 10.908 0.000 ( +0.0% ) 0.12 0.13 -4.2% 4.363 4.475
TTbar_14TeV+Run4D127_HLTPhase2WithNanoValid 3000.0002 204.308 204.308 0.000 ( +0.0% ) 0.11 0.12 -6.0% 4.800 4.957
TTbar_14TeV+Run4D127_HLTPhase2WithNanoAndDQM 3000.0003 8.326 8.326 0.000 ( +0.0% ) 0.10 0.11 -4.9% 4.876 4.949
TTbar_14TeV+Run4D127_NGTScoutingWithNano 3000.0004 11.256 11.256 0.000 ( +0.0% ) 0.13 0.13 -2.4% 4.190 4.277
TTbar_14TeV+Run4D127_NGTScoutingWithNanoAndDQM 3000.0005 6.247 6.247 0.000 ( +0.0% ) 0.11 0.11 -3.5% 4.704 4.772
TTbar_14TeV+Run4D127_NGTScoutingWithNanoValid 3000.0006 172.716 172.716 0.000 ( +0.0% ) 0.12 0.13 -4.9% 4.645 4.732
TTbar_14TeV+Run4D127_L1NGTScoutingWithNanoValid 3000.0007 130.845 130.845 0.000 ( +0.0% ) 0.11 0.12 -8.9% 5.268 5.502

NANO Comparison Summary

Summary:

  • You potentially removed 300 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 3
  • DQMHistoTests: Total histograms compared: 436
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 436
  • DQMHistoTests: Total skipped: 0
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 2 files compared)
  • Checked 49 log files, 33 edm output root files, 3 DQM output files
  • TriggerResults: no differences found

@mmusich

mmusich commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@cms-sw/l1-l2 @cms-sw/xpog-l2 can you take a look? There is some HLT dev that depends on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants